/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * AdminScreen.java
 *
 * Created on 09/05/2011, 10:37:49
 */

package sisgel.screen;

import javax.swing.SwingUtilities;
import javax.swing.UIManager;

/**
 *
 * @author amonra
 */
public class Screen extends javax.swing.JFrame {

    private String look = "";
    /** Creates new form AdminScreen */
    public Screen() {
    	initComponents();

        //menuCadastrar.setVisible(false);
        this.setSize(this.getToolkit().getScreenSize());
        this.lookAndFeel();
	}

	/** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        desktopPanel = new javax.swing.JDesktopPane();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        menuCadastrar = new javax.swing.JMenu();
        jMenuItem7 = new javax.swing.JMenuItem();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenu4 = new javax.swing.JMenu();
        jMenuItem6 = new javax.swing.JMenuItem();
        jMenuItem5 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jMenu1.setText("Sistema");
        jMenuBar1.add(jMenu1);

        menuCadastrar.setText("Cadastrar");

        jMenuItem7.setText("Usuário");
        jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem7ActionPerformed(evt);
            }
        });
        menuCadastrar.add(jMenuItem7);

        jMenuItem1.setText("Laboratório");
        menuCadastrar.add(jMenuItem1);

        jMenuItem4.setText("Equipamento");
        menuCadastrar.add(jMenuItem4);

        jMenuBar1.add(menuCadastrar);

        jMenu4.setText("Consultar");

        jMenuItem6.setText("Equipamentos");
        jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem6ActionPerformed(evt);
            }
        });
        jMenu4.add(jMenuItem6);

        jMenuItem5.setText("Laboratórios");
        jMenu4.add(jMenuItem5);

        jMenuBar1.add(jMenu4);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(desktopPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(desktopPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
        // TODO add your handling code here:
        createQueryLaboratory();

    }//GEN-LAST:event_jMenuItem6ActionPerformed

    private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed
        // TODO add your handling code here:
        createRegister();
    }//GEN-LAST:event_jMenuItem7ActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JDesktopPane desktopPanel;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu4;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JMenuItem jMenuItem6;
    private javax.swing.JMenuItem jMenuItem7;
    private javax.swing.JMenu menuCadastrar;
    // End of variables declaration//GEN-END:variables

     private QueryLaboratory queryLaboratory;
     private javax.swing.JInternalFrame register;
     
     void createRegister() {
         
         if (register == null)
             register = new Register();
         
         desktopPanel.add(register);
         register.setVisible(true);
     }

     void createQueryLaboratory() {

        if(queryLaboratory == null){
            queryLaboratory = new QueryLaboratory();
        }

        desktopPanel.add(queryLaboratory);
        queryLaboratory.setVisible(true);
        queryLaboratory.setPosicao();
        //insertProfessor.setPosicao();
    }

     void lookAndFeel() {
        try {

            String lookAndFeel = UIManager.getSystemLookAndFeelClassName();
            UIManager.setLookAndFeel(lookAndFeel);
        } catch (Exception erro){
            
        }
     }
}
